
import tkinter
import time
import _thread

def foo1():
    for i in range(10):
        print(i)
        time.sleep(1)

def foo1b():
    _thread.start_new_thread(foo1, ())

def foo2():
    print("foo2")

root = tkinter.Tk()
root.geometry("400x400")

btn = tkinter.Button(root,text="BTN1",command=foo1)
btn.pack()

btn2 = tkinter.Button(root,text="BTN2",command=foo2)
btn2.pack()

root.mainloop()
